<?php
function protect_page() {
    if (logged_in() === false){
        header('Location: protected.php');
        exit();
    }

}
function protect_reg(){
    if (logged_in() === true){
        header('Location: xreg.php');
        exit();
    }
}

function array_sanitize(&$item){
    $item = mysql_real_escape_string($item);
}
function sanitize($data) {
    return mysql_real_escape_string($data);
}

function output_error($error){
    return "<ul><li>'" . implode('</li><li>', $error) . "</li></ul>";
}
?>